home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1997 / MacHack 1997.toast / Hacks / Hacks ’97 / Warrior’s Progress / source code / Source / Libraries / Fonts / Face.cp next >
Encoding:
Text File  |  1997-06-28  |  1.5 KB  |  72 lines  |  [TEXT/CWIE]

  1. // Face.cp
  2.  
  3. #ifndef Face_h
  4. #include "Face.h"
  5. #endif
  6. #ifndef GrafPortObject_h
  7. #include "GrafPortObject.h"
  8. #endif
  9.  
  10. bool Face::operator==( const Face& f ) const
  11.   {
  12.     return font == f.font
  13.          && size == f.size
  14.          && style == f.style;
  15.   }
  16.  
  17. Face Face::System( ScriptCode script )
  18.   {
  19.     uint32 packed = GetScriptVariable( script, smScriptSysFondSize );
  20.     return Face( FontNumber::Make( Word1( packed ) ),
  21.                      FontSize::Make( Word0( packed ) ),
  22.                      normal );
  23.   }
  24.  
  25. Face Face::Application( ScriptCode script )
  26.   {
  27.     uint32 packed = GetScriptVariable( script, smScriptAppFondSize );
  28.     return Face( FontNumber::Make( Word1( packed ) ),
  29.                      FontSize::Make( Word0( packed ) ),
  30.                      normal );
  31.   }
  32.  
  33. Face Face::Small( ScriptCode script )
  34.   {
  35.     uint32 packed = GetScriptVariable( script, smScriptSmallFondSize );
  36.     return Face( FontNumber::Make( Word1( packed ) ),
  37.                      FontSize::Make( Word0( packed ) ),
  38.                      normal );
  39.   }
  40.  
  41. Face Face::Help( ScriptCode script )
  42.   {
  43.     uint32 packed = GetScriptVariable( script, smScriptHelpFondSize );
  44.     return Face( FontNumber::Make( Word1( packed ) ),
  45.                      FontSize::Make( Word0( packed ) ),
  46.                      normal );
  47.   }
  48.  
  49. const Face& Face::System()
  50.   {
  51.     static Face face = System( smSystemScript );
  52.     return face;
  53.   }
  54.  
  55. const Face& Face::Application()
  56.   {
  57.     static Face face = Application( smSystemScript );
  58.     return face;
  59.   }
  60.  
  61. const Face& Face::Small()
  62.   {
  63.     static Face face = Small( smSystemScript );
  64.     return face;
  65.   }
  66.  
  67. const Face& Face::Help()
  68.   {
  69.     static Face face = Help( smSystemScript );
  70.     return face;
  71.   }
  72.